package com.ktjy;

public class Demo2 {
    public static void main(String[] args) throws ClassNotFoundException {
        //1.解剖.class文件的基本信息
        Class clz= Person.class;

        //获取一下类名，包名，父类，实现的接口
        System.out.println("类名："+clz.getName());
        System.out.println("简单类名："+clz.getSimpleName());

        System.out.println("所在的包："+clz.getPackageName());

        System.out.println("父类："+clz.getSuperclass().getSimpleName());

        for (Class anInterface : clz.getInterfaces()) {
            System.out.println("实现的接口："+anInterface.getSimpleName());
        }
    }
}
